<%--
  Created by IntelliJ IDEA.
  User: qintao30057
  Date: 2018/1/9
  Time: 9:05
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html>
<head>
    <title>枚举管理</title>
    <%@ include file="../../common/meta.jsp" %>
    <link href="${ctx}/css/page/common-list.css?t=${now}" rel="stylesheet">
    <link href="${ctx}/css/page/common-search.css?t=${now}" rel="stylesheet">
    <script src="${ctx}/js/plugins/validate/jquery.validate.custom.js?t=20181024"></script>
</head>
<style>
</style>
<script>
    var p_groupCode = '${groupCode}';
    var p_groupName = '${groupName}';
    var searchDictInfo = ${searchDictInfo};
</script>
<body class="gray-bg">
<div class="wrapper wrapper-content animated fadeInRight">
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5><i class="fa fa-search"></i> 筛选查询</h5>
                </div>
                <div class="ibox-content ibox-content-search">
                    <form class="form-horizontal m-t" id="searchForm" novalidate="novalidate">
                        <div class="form-group">
                            <label class="col-sm-1 control-label">查询枚举：</label>
                            <div class="col-sm-5">
                                <input type="text" name="dictName" onkeydown="if(event.keyCode==13){doRefresh();return false;}" id="dictName" class="form-control"  placeholder="输入枚举名称" maxlength="30">
                            </div>
                            <div class="ibox-tools ibox-tools-search">
                                <button type="button" class="btn btn-primary btn-outline" onclick="doRefresh()">查询</button>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5><i class="fa fa-table"></i> 枚举信息</h5>
                    <div class="ibox-tools col-sm-offset-2">
                        <c:if test="${userType == 'super' || not empty btnMap['addEnum']}">
                            <button class="btn btn-primary btn-outline" onclick="openAddEnumPage()">新增</button>
                        </c:if>
                        <c:if test="${userType == 'super' || not empty btnMap['editEnum']}">
                            <button class="btn btn-primary btn-outline" onclick="openEditEnumPage()">编辑</button>
                        </c:if>
                        <c:if test="${userType == 'super' || not empty btnMap['delEnum']}">
                            <button class="btn btn-primary btn-outline" onclick="deleteEnum()">删除</button>
                        </c:if>
                        <button class="btn btn-primary btn-outline" onclick="doRefresh()">刷新</button>
                        <button class="btn btn-primary btn-outline" onclick="doBack()">返回</button>
                    </div>
                </div>
                <div class="ibox-content">
                    <table class='table table-striped table-hover'
                           id="dataTable"  data-height="400"
                           data-toggle="table"
                           data-url="${ctx}/sysDictionary/pageFindDictData?t=${now}"
                           data-pagination="true"
                           data-side-pagination="server"
                           data-striped="true"
                           data-response-handler="handleServerResult"
                           data-query-params-type=""
                           data-query-params="getParams"
                           data-page-size="${defaultPageSize}"
                           data-page-list="${pageList}">
                        <thead>
                        <tr>
                            <th data-field="id" data-visible="false">字典ID</th>
                            <th data-field="groupCode" data-visible="false">字典类型</th>
                            <th data-field="groupName" data-align="center" data-width="220px">字典名称</th>
                            <th data-field="dictName" data-formatter="formatName" data-events="actionEvents" data-align="center" data-width="220px">枚举名称</th>
                            <th data-field="dictCode" data-align="center" data-width="150px">枚举编码</th>
                            <th data-field="sortNum" data-align="center" data-width="70px">排序</th>
                            <th data-field="remark" data-align="center">备注</th>
                            <th data-field="creator" data-formatter="formatterCreator" data-align="center" data-width="120px">创建人</th>
                            <th data-field="operator" data-formatter="formatterOperator" data-align="center" data-width="120px">编辑人</th>
                            <th data-field="status" data-visible="false">状态</th>
                            <th data-field="extValue" data-visible="false">扩展数据项</th>
                        </tr>
                        </thead>
                    </table>
                </div>
            </div>
        </div>
    </div>
    <div class="row">
        <div class="col-sm-12">
            <div class="text-center">${companyName}</div>
        </div>
    </div>
</div>

<div id="editEnumPage" class="modal" tabindex="-1" role="dialog" data-backdrop="static" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content animated bounceInRight">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                <h4 id="_modelTitle" style="text-align: center; font-weight: normal;">新增枚举</h4>
            </div>
            <div class="modal-body modal-body-height">
                <form class="form-horizontal m-t" id="_dictDataForm" novalidate="novalidate">
                    <div class="form-group form-group-new">
                        <label class="col-sm-2 control-label"><span style="color: red">*</span>字典名称：</label>
                        <div class="col-sm-8">
                            <input type="text" id="_groupName" name="_groupName" class="form-control" disabled="disabled">
                            <span class="help-block m-b-none tip"></span>
                        </div>
                    </div>
                    <div class="form-group form-group-new">
                        <label class="col-sm-2 control-label"><span style="color: red">*</span>字典编码：</label>
                        <div class="col-sm-8">
                            <input type="text" id="_groupCode" name="_groupCode" class="form-control" disabled="disabled">
                            <span class="help-block m-b-none tip"></span>
                        </div>
                    </div>
                    <div class="form-group form-group-new">
                        <label class="col-sm-2 control-label"><span style="color: red">*</span>枚举名称：</label>
                        <div class="col-sm-8">
                            <input type="text" id="_dictName" name="_dictName" class="form-control" maxlength="20" required>
                            <span class="help-block m-b-none tip"></span>
                        </div>
                    </div>
                    <div class="form-group form-group-new">
                        <label class="col-sm-2 control-label"><span style="color: red">*</span>枚举编码：</label>
                        <div class="col-sm-8">
                            <input type="text" id="_dictCode" name="_dictCode" class="form-control" maxlength="32" required>
                            <span class="help-block m-b-none tip"></span>
                        </div>
                    </div>
                    <div class="form-group form-group-new">
                        <label class="col-sm-2 control-label">排序：</label>
                        <div class="col-sm-8">
                            <input type="text" id="_sortNum" name="_sortNum" class="form-control" maxlength="9" isPInteger="true">
                            <span class="help-block m-b-none tip"></span>
                        </div>
                    </div>
                    <div class="form-group form-group-new">
                        <label class="col-sm-2 control-label">拓展字段：</label>
                        <div class="col-sm-8">
                            <input type="text" id="_extValue" name="_extValue" class="form-control" maxlength="250">
                            <span class="help-block m-b-none tip"></span>
                        </div>
                    </div>
                    <div class="form-group form-group-new">
                        <label class="col-sm-2 control-label">备注：</label>
                        <div class="col-sm-8">
                            <textarea type="text" id="remark" name="remark" class="form-control" maxlength="128" style="height: 50px; resize: none;"></textarea>
                            <span class="help-block m-b-none tip"></span>
                        </div>
                    </div>
                </form>
            </div>
            <div class="modal-footer" style="text-align: center;">
                <button class="btn btn-primary" onclick="doSaveEnum()" id="_saveBtn">保存</button>
                <button class="btn btn-white" onclick="closeEditEnumPage();">取消</button>
            </div>
        </div>
    </div>
</div>

<div id="enumInfoPage" class="modal" tabindex="-1" role="dialog" data-backdrop="static" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content animated bounceInRight">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                <h4 style="text-align: center; font-weight: normal;">枚举详情</h4>
            </div>
            <div class="modal-body modal-body-height">
                <form class="form-horizontal m-t" id="_dictDataForm1" novalidate="novalidate">
                    <div class="form-group">
                        <label class="col-sm-2 control-label">字典名称：</label>
                        <label class="col-sm-8 control-label control-label-content" id="lab_groupName"></label>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">字典编码：</label>
                        <label class="col-sm-8 control-label control-label-content" id="lab_groupCode"></label>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">枚举名称：</label>
                        <label class="col-sm-8 control-label control-label-content" id="lab_dictName"></label>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">枚举编码：</label>
                        <label class="col-sm-8 control-label control-label-content" id="lab_dictCode"></label>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">排序：</label>
                        <label class="col-sm-8 control-label control-label-content" id="lab_sortNum"></label>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">拓展字段：</label>
                        <label class="col-sm-8 control-label control-label-content" id="lab_extValue"></label>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">备注：</label>
                        <label class="col-sm-8 control-label control-label-content" id="lab_remark"></label>
                    </div>
                </form>
            </div>
            <div class="modal-footer" style="text-align: center;">
                <button class="btn btn-white" onclick="closeEnumInfoPage();">取消</button>
            </div>
        </div>
    </div>
</div>

<script src="${ctx}/js/sys/dict/enumMgr.js?t=${now}"></script>
</body>
</html>

